class Account < ActiveRecord::Base
  has_one :group

  def calculateBrokerage(amount)
    result = 0
    if brokerage_percents != nil
      result = (brokerage_percents*amount)/100
    end
    if not_less_then != nil and not_less_then > result
      result = not_less_then
    end
    result
  end
  
end
